package org.gocom.components.coframe.auth;

import com.eos.system.annotation.Bizlet;
import commonj.sdo.DataObject;

public class ContactUserRole {
	/**
	 * 用户角色数据转换为字符创
	 * @param roles 用户所拥有的角色
	 * @return 转换后的角色串
	 * <P>作成者：houfy
	 * <P>作成日：2015-09-23
	 */
	@Bizlet("")
	public String getUserRoles(DataObject[] roles) {
		String rtnRoles = "";
		
		if(roles.length == 0){
			return rtnRoles;
		}
		
		for(DataObject roleObject : roles){
			rtnRoles = rtnRoles + roleObject.get("roleCode").toString() + ",";
		}
		
		rtnRoles=rtnRoles.substring(0, rtnRoles.length()-1);
		
		return rtnRoles;
	}
}
